{% extends 'index.html' %}

{% block sidebar %}{% endblock %}

{% block content %}
    <form class="form-horizontal" role="form" method="post">
    {% csrf_token %}
    {% for field in form_obj %}
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">
                {{ field.label }}
            </label>
            <div class="col-md-4 col-sm-4">
                {{ field }}
                {% for error_data in field.errors.get_json_data %}
                    <span style="color: red; margin-right: 5px">{{ error_data.message }};</span>
                {% endfor %}
            </div>
        </div>
    {% endfor %}
        <div class="row">
            <div class="col-md-3 col-sm-3 col-sm-offset-3 " style="color: red">{{ form_obj.non_field_errors.0 }}</div>
        </div>

    <a href="/backend/Host/preview/" class="btn btn-info col-sm-offset-1">取消并返回</a>
    <button type="submit" class="btn btn-success col-sm-offset-3 " >保存</button>
    </form>
{% endblock %}